layui.$.ajax({
    url: "user/getuserinfo",
    success: function (result) {
        let data=result.data;
        let code=result.code;
        let msg=result.msg;
        if(code==200){
            layui.$("#topbox").html(
                '<li><a href="shopping/userinfo">'+data.nickname+'</a><span>|</span></li>\n' +
                '<li className="cart">\n' +
                '    <a href="shopping/cart">\n' +
                '        <p>购物车</p>\n' +
                '    </a>\n' +
                '</li>');
        }else{
            layui.$("#topbox").html('<li><a id="" href="shopping/login">登录</a><span>|</span></li>\n' +
                '<li><a href="shopping/register">注册</a><span>|</span></li>\n' +
                '<li className="cart">\n' +
                '    <a href="shopping/cart">\n' +
                '        <p>购物车</p>\n' +
                '    </a>\n' +
                '</li>');
        }
    }
});
